<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>历史记录</title>
    <link rel="stylesheet" href="css/history.css">
    <link rel="icon" sizes="any" href="img/favicon.ico">
</head>

<body>
    <!-- b站logo->投稿 -->
    <header>
        <div id="history_top">
            <!-- 首页 -->
            <div id="history_top_left">
                <a href="index.html">
                    <span class="span1">
                        <svg width="18" height="18" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg"
                            class="zhuzhan-icon">
                            <path fill-rule="evenodd" clip-rule="evenodd"
                                d="M3.73252 2.67094C3.33229 2.28484 3.33229 1.64373 3.73252 1.25764C4.11291 0.890684 4.71552 0.890684 5.09591 1.25764L7.21723 3.30403C7.27749 3.36218 7.32869 3.4261 7.37081 3.49407H10.5789C10.6211 3.4261 10.6723 3.36218 10.7325 3.30403L12.8538 1.25764C13.2342 0.890684 13.8368 0.890684 14.2172 1.25764C14.6175 1.64373 14.6175 2.28484 14.2172 2.67094L13.364 3.49407H14C16.2091 3.49407 18 5.28493 18 7.49407V12.9996C18 15.2087 16.2091 16.9996 14 16.9996H4C1.79086 16.9996 0 15.2087 0 12.9996V7.49406C0 5.28492 1.79086 3.49407 4 3.49407H4.58579L3.73252 2.67094ZM4 5.42343C2.89543 5.42343 2 6.31886 2 7.42343V13.0702C2 14.1748 2.89543 15.0702 4 15.0702H14C15.1046 15.0702 16 14.1748 16 13.0702V7.42343C16 6.31886 15.1046 5.42343 14 5.42343H4ZM5 9.31747C5 8.76519 5.44772 8.31747 6 8.31747C6.55228 8.31747 7 8.76519 7 9.31747V10.2115C7 10.7638 6.55228 11.2115 6 11.2115C5.44772 11.2115 5 10.7638 5 10.2115V9.31747ZM12 8.31747C11.4477 8.31747 11 8.76519 11 9.31747V10.2115C11 10.7638 11.4477 11.2115 12 11.2115C12.5523 11.2115 13 10.7638 13 10.2115V9.31747C13 8.76519 12.5523 8.31747 12 8.31747Z"
                                fill="currentColor"></path>
                        </svg>
                    </span>
                    <span class="span2">首页</span>
                </a>
            </div>
            <!-- 搜索框 -->
           
            <!-- 登录->投稿 -->
            <div id="history_top_right">
                <ul>
                    <li>
                        <div id="login">
                            <a href="">
                                <span class="spanMsg">登录</span>
                            </a>
                        </div>
                    </li>

                    <li>
                        <div>
                            <a href="personalCenter.html">
                                <span class="spanImg">
                                    <svg width="20" height="21" viewBox="0 0 20 21" fill="none"
                                        xmlns="http://www.w3.org/2000/svg" class="right-entry-icon">
                                        <path fill-rule="evenodd" clip-rule="evenodd"
                                            d="M11.0505 3.16759L12.7915 6.69573C12.954 7.02647 13.2702 7.25612 13.6349 7.30949L17.5294 7.87474C18.448 8.00817 18.8159 9.13785 18.1504 9.78639L15.3331 12.5334C15.0686 12.7905 14.9481 13.1609 15.0104 13.5256L15.6759 17.4031C15.8328 18.3184 14.8721 19.0171 14.0497 18.5845L10.5661 16.7537C10.2402 16.5823 9.85042 16.5823 9.52373 16.7537L6.04087 18.5845C5.21848 19.0171 4.2578 18.3184 4.41468 17.4031L5.07939 13.5256C5.14166 13.1609 5.02198 12.7905 4.75755 12.5334L1.9394 9.78639C1.27469 9.13785 1.64182 8.00817 2.56126 7.87474L6.4549 7.30949C6.82041 7.25612 7.13578 7.02647 7.29832 6.69573L9.04015 3.16759C9.45095 2.33468 10.6389 2.33468 11.0505 3.16759Z"
                                            stroke="currentColor" stroke-width="1.6" stroke-linecap="round"
                                            stroke-linejoin="round"></path>
                                        <path
                                            d="M11.603 11.8739C11.413 12.5556 10.7871 13.0554 10.0447 13.0554C9.29592 13.0554 8.66679 12.5467 8.48242 11.8569"
                                            stroke="currentColor" stroke-width="1.6" stroke-linecap="round"
                                            stroke-linejoin="round"></path>
                                    </svg>
                                </span>
                                <span class="spanMsg1">收藏</span>
                            </a>

                        </div>
                    </li>
                    <li>
                        <div>
                            <a href="">
                                <span class="spanImg">
                                    <svg width="20" height="21" viewBox="0 0 20 21" fill="none"
                                        xmlns="http://www.w3.org/2000/svg" class="right-entry-icon">
                                        <path fill-rule="evenodd" clip-rule="evenodd"
                                            d="M10 1.74286C5.02955 1.74286 1 5.7724 1 10.7429C1 15.7133 5.02955 19.7429 10 19.7429C14.9705 19.7429 19 15.7133 19 10.7429C19 5.7724 14.9705 1.74286 10 1.74286ZM10.0006 3.379C14.0612 3.379 17.3642 6.68282 17.3642 10.7426C17.3642 14.8033 14.0612 18.1063 10.0006 18.1063C5.93996 18.1063 2.63696 14.8033 2.63696 10.7426C2.63696 6.68282 5.93996 3.379 10.0006 3.379Z"
                                            fill="currentColor"></path>
                                        <path d="M9.99985 6.6521V10.743" stroke="currentColor" stroke-width="1.7"
                                            stroke-linecap="round"></path>
                                        <path d="M12.4545 10.7427H10" stroke="currentColor" stroke-width="1.7"
                                            stroke-linecap="round"></path>
                                    </svg>
                                </span>
                                <span class="spanMsg1">历史</span>
                            </a>

                        </div>
                    </li>
                    <li>
                        <div>
                            <a href="createCenter.html">
                                <span class="spanImg">
                                    &nbsp;&nbsp;&nbsp;&nbsp;<svg width="20" height="21" viewBox="0 0 20 21" fill="none"
                                        xmlns="http://www.w3.org/2000/svg" class="right-entry-icon">
                                        <mask id="mask0" mask-type="alpha" maskUnits="userSpaceOnUse" x="2" y="1"
                                            width="16" height="20">
                                            <path fill-rule="evenodd" clip-rule="evenodd"
                                                d="M2.5 1.74286H17.5V20.0762H2.5V1.74286Z" fill="currentColor">
                                            </path>
                                        </mask>
                                        <g mask="url(#mask0)">
                                            <path fill-rule="evenodd" clip-rule="evenodd"
                                                d="M9.99999 1.74286C9.92916 1.74286 9.85916 1.74369 9.78833 1.74536C5.85416 1.85453 2.58416 5.14869 2.50166 9.08286C2.44999 11.5404 3.58666 13.7304 5.36999 15.1337C5.52166 15.2529 5.63166 15.4162 5.67333 15.6045L6.30416 18.447C6.51583 19.3987 7.36083 20.0762 8.33583 20.0762H11.6617C12.6383 20.0762 13.4842 19.3987 13.6958 18.4445L14.3275 15.602C14.3692 15.4154 14.4775 15.2537 14.6275 15.1354C16.3733 13.7629 17.5 11.637 17.5 9.24286C17.5 5.10036 14.1425 1.74286 9.99999 1.74286ZM10.0003 3.40939C13.2161 3.40939 15.8336 6.02606 15.8336 9.24273C15.8336 11.0386 15.0186 12.7086 13.5978 13.8252C13.1428 14.1827 12.8244 14.6852 12.7011 15.2402L12.0686 18.0827C12.0269 18.2752 11.8586 18.4094 11.6619 18.4094H8.33609C8.14109 18.4094 7.97359 18.2761 7.93192 18.0852L7.30025 15.2427C7.17609 14.6869 6.85775 14.1827 6.40109 13.8236C4.94359 12.6769 4.12942 10.9619 4.16859 9.11773C4.23192 6.05523 6.77442 3.49606 9.83442 3.41189C9.88942 3.41023 9.94525 3.40939 10.0003 3.40939Z"
                                                fill="currentColor"></path>
                                            <path d="M10 6.81299L8.81253 9.18726H11.1875L9.99952 11.561"
                                                stroke="currentColor" stroke-width="1.6" stroke-linecap="round"
                                                stroke-linejoin="round"></path>
                                        </g>
                                        <path d="M6.66656 15.9095H13.3332" stroke="currentColor" stroke-width="1.7">
                                        </path>
                                    </svg>
                                </span>
                                <span class="spanMsg1">创作中心</span>
                            </a>

                        </div>
                    </li>
                    <li>
                        <div id="submits">
                            <a href="createCenter.html">
                                <span class="spanImg1">
                                    <svg width="18" height="18" viewBox="0 0 18 18" fill="none"
                                        xmlns="http://www.w3.org/2000/svg" class="header-upload-entry__icon">
                                        <path
                                            d="M12.0824 10H14.1412C15.0508 10 15.7882 10.7374 15.7882 11.6471V12.8824C15.7882 13.792 15.0508 14.5294 14.1412 14.5294H3.84707C2.93743 14.5294 2.20001 13.792 2.20001 12.8824V11.6471C2.20001 10.7374 2.93743 10 3.84707 10H5.90589"
                                            stroke="currentColor" stroke-width="1.7" stroke-linecap="round"
                                            stroke-linejoin="round"></path>
                                        <path d="M8.99413 11.2353L8.99413 3.82353" stroke="currentColor"
                                            stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round">
                                        </path>
                                        <path d="M12.0823 6.29413L8.9941 3.20589L5.90587 6.29413" stroke="currentColor"
                                            stroke-width="1.7" stroke-linecap="round" stroke-linejoin="round"></path>
                                    </svg>
                                </span>
                                <span class="spanMsg2">投稿</span>
                            </a>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </header>
    <!-- 主体note -->
    <section id="section">
        <div id="history_note">
            <!-- 历史记录和搜索框 -->
            <div id="history_note_top">
                <div id="history_note_top_left">
                    <img src="img/historyImg.png" alt="">
                    <h1>历史记录</h1>
                </div>
                <!-- 搜索框 -->
               
            </div>
            <!-- 主体 -->
            <div id="history_note_bottom">
                
            </div>
        </div>
    </section>
    
</body>
	<script src="js/jquery.js"></script>
	<script>
		allVideo()
		function allVideo(){
			$.ajax({
				type: "GET",
	            url: "watchHisory.do",
	            data: {
	            	
	            },
	            success: function(data) {
	            	
	            	$(".spanMsg").text("")
	            	$("#login").css({
	            		"background-image":"url("+data.data[1].avatarUrl+")",
	            		"background-size":"cover"
           			})
	            	for(var i = 0;i<data.data[0].length;i++){
	            		$("#history_note_bottom").append(`
	        					<div class="note_bottom_upDiv">
	        						<div class="note_bottom_topDiv">
	        							<img src='${data.data[0][i].coverUrl}' alt="笔记图片">
	        						</div>
	        						<div class="note_bottom_inDiv">
	        							<input type='hidden' value='${data.data[0][i].videoId}'>
	        							<p>${data.data[0][i].title}</p>
	        							<p>${data.data[0][i].description}</p>
	        						</div>
	        					</div>
	            		`);
	            	
	            	}
	            }
			});
		}
		$("#history_note_bottom").on("click",".note_bottom_upDiv",function(){
			videoJumpTo($(this).find("input").val())
		})
		function videoJumpTo(videoId) {
	  	  $.ajax({
	  	    url: "selectVideo.do",
	  	    type: "GET",
	  	    data: { 
	  	    	action:"send",
	  	    	videoId: videoId 
	  	    	},
	  	    success: function() {
	  	        localStorage.setItem('pendingVideoId', videoId);
	  	        window.open("video.html", "_blank");
	  	    }
	  	  });
	  	}
	</script>
</html>